<?php
require_once('./modules/config.inc');

function loadCurrentModule($page)
{
	global $siteName;
	global $pageLayout;
	$config = Config::getInstance();

	include_once("./pages/default.inc");

	if (isset($page) && $page != "")
	{ 
		if( !file_exists("./pages/".$page.".inc"))
			include_once("./pages/404.inc");
		else
			include_once("./pages/".$page.".inc");
	}

	$renderer->init();

	$siteName = $config->get("./siteName");
	$pageLayout = $config->get("./pageLayout");
	
	$renderer->pageLoad();
	
	$renderer->renderHeader();
	$renderer->renderLoginBox();
	$renderer->renderSearch();
	$renderer->handleBreadcrumbs();
	$renderer->renderContent();	
	$renderer->renderMainNavigation();
	$renderer->renderLocalNavigation();
	$renderer->renderFooter();
	$renderer->renderAnalytics();
}
?>
